home *** CD-ROM | disk | FTP | other *** search
-
- /*
- ** RSTRUCT.H
- **
- ** - Structure declarations for most driver calls
- **
- ** If a call structure is not declared here, its probably just a WORD or
- ** DWORD.
- **
- ** HISTORY:
- ** 10/01/90 Final (v1.0) -by- JYG
- */
-
- /* *** Device Header *** */
- /* This is a node in the linked list of device headers for ALL CDROM
- ** drives that is returned with the MSCDEX Int2f AH=15h call.
- */
-
- typedef struct Dev_Hdr {
- struct Dev_Hdr _far *sdevnext; // Pointer to next dev header
- WORD sdevatt; // Attributes of the device
- void (*sdevstrat)(); // Strategy entry point
- void (*sdevint)(); // Interrupt entry point
- BYTE sdevname[8]; // Name of device
- WORD sdevrsvd; // Reserved word
- BYTE sdevlet; // Drive letter of first unit
- BYTE sdevunits; // Number of units handled
- BYTE sigf[6]; // signature field
- } Dev_Hdr;
-
- /* *** Device list node identifier *** */
-
- typedef struct Dev_List {
- BYTE sub_unit;
- Dev_Hdr _far *dev_addr;
- } Dev_List;
-
- /* *** Request header structure definition *** */
- /* A Properly formatted request header should always return with the
- ** the status word correctly set
- */
-
- typedef struct Request_Hdr {
- BYTE len;
- BYTE unit;
- BYTE cmd;
- WORD status;
- BYTE rsvd[8];
- } Request_Hdr;
-
- /* *** INIT command request header *** */
-
- typedef struct Init_Hdr {
- Request_Hdr rqh;
- BYTE units;
- BYTE _far *endaddr;
- BYTE _far *bpbarr;
- BYTE devno;
- } Init_Hdr;
-
- /* *** READ/Write LONG command request header *** */
-
- typedef struct ReadWriteL_Hdr {
- Request_Hdr rqh;
- BYTE addrmd; // Addressing Mode (REDBOOK|HSG)
- BYTE _far *xfer; // Transfer Buffer Address
- WORD nsects; // Number of sectors to read/write
- DWORD start; // Starting address
- BYTE mode; // Read/Write Mode (COOKED|RAW)
- BYTE ilsize; // Interleave size
- BYTE ilskip; // Interleave skip
- } ReadWriteL_Hdr;
-
- /* *** SEEK command request header structure *** */
-
- typedef struct SeekReq_Hdr {
- Request_Hdr rqh;
- BYTE addrmd; // Addressing Mode (REDBOOK|HSG)
- DWORD zero; // -
- WORD nsects; // Number of sectors to read(?)
- DWORD start; // Starting sector number
- } SeekReq_Hdr;
-
-
- /* *** PLAY command request header *** */
-
- typedef struct PlayReq_Hdr {
- Request_Hdr rqh;
- BYTE addrmd; // Addressing Mode (REDBOOK|HSG)
- DWORD start; // Starting sector number
- DWORD num; // Number of sectors to play
- } PlayReq_Hdr;
-
-
- /* *** IOCTL Command structures *** */
-
- /* *** (I/O) IOCTL command request header structure definition *** */
-
- typedef struct Ioctl_Hdr {
- Request_Hdr rqh;
- BYTE media; // Media descriptor bytes from BPB (=0)
- BYTE _far *xfer; // Transfer address
- // (ptr to the SUBSTRUCTURE)
- WORD nbytes; // Number of bytes to transfer
- // this is: sizeof(SUBSTRUCTURE)
- WORD sector; // Starting sector number (=0)
- DWORD valid; // Pointer to requested vol ID if
- // error 0fh (=0)
- } Ioctl_Hdr;
-
- /* *** The IOCTL Substructures - (subordinate structures) *** */
- /* *** ************************************************** *** */
-
- /* *** (I) Raddr_Rec - Return address of device header *** */
-
- typedef struct Raddr_Rec {
- BYTE code; // (=0)
- DWORD addr; // Return field for device header addr
- } Raddr_Rec;
-
- /* *** (I) LocHead_Rec *** */
- /* Returns the address of the head location
- */
- typedef struct LocHead_Rec {
- BYTE code; // (=1)
- BYTE addrmode; // Addressing Mode (REDBOOK|HSG)
- DWORD drvhead; // Return field for head location
- } LocHead_Rec;
-
- /* *** (I) ErrStat is unsupported *** */
-
- /* *** (I/O) AudInfo_Rec *** */
- /* For Audio status and control
- */
- typedef struct AudInfo_Rec {
- BYTE code; // ((I? =4) | (O? =3))
- BYTE in0; // Input Channel (0-3) for output 0
- BYTE vol0; // Volume (0-0xff) for output 0
- BYTE in1; // Input Channel (0-3) for output 1
- BYTE vol1; // Volume (0-0xff) for output 1
- BYTE in2; // Input Channel (0-3) for output 2
- BYTE vol2; // Volume (0-0xff) for output 2
- BYTE in3; // Input Channel (0-3) for output 3
- BYTE vol3; // Volume (0-0xff) for output 3
- } AudInfo_Rec;
-
- /* *** (I/O) DrvBytes_Rec *** */
- /* For Read Drive Bytes, hardware specific information
- ** The HITACHI's just return an ASCII version string.
- ** NOTE: This is actually NOT defined for the the IOCTLO fcn 4
- */
- typedef struct DrvBytes_Rec {
- BYTE code; // ((I? =5) | (O? =4))
- BYTE nbytes; // Number of bytes transfered
- BYTE buf[128]; // Buffer for received data
- } DrvBytes_Rec;
-
- /* *** (I) DevStat_Rec *** */
- /* VERY important. For returning the current drive status and
- ** specific information about the drive hardware. The returned
- ** DWORD should be always correct.
- */
- typedef struct DevStat_Rec {
- BYTE code; // (=6)
- DWORD params; // Returned device parameters
- } DevStat_Rec;
-
- /* *** (I) SectSize_Rec *** */
- /* The sector size (in bytes) for the read mode specified
- */
- typedef struct SectSize_Rec {
- BYTE code; // (=7)
- BYTE rmode; // Read mode (RAW|COOKED)
- WORD sectsize; // Returned sector size value
- } SectSize_Rec;
-
- /* *** (I) VolSize_Rec *** */
- /* Return structure for the volume size (in sectors) of the current
- ** disc. Equivalent to the address of the lead out track
- */
- typedef struct VolSize_Rec {
- BYTE code; // (=8)
- DWORD volsize; // Returned volume size
- } VolSize_Rec;
-
- /* *** (I) MedChng_Rec *** */
- /* The Media changed byte should return 1,0,or ffh. This is a reduced
- ** functionality media check.
- */
- typedef struct MedChng_Rec {
- BYTE code; // (=9)
- BYTE medbyte; // Returned media byte
- } MedChng_Rec;
-
- /* *** (I) DiskInfo_Rec *** */
- /* Return structure for VTOC information, from the Qchannel info in the
- ** lead in track.
- ** Information is obtained from lead in track
- */
- typedef struct DiskInfo_Rec {
- BYTE code; // (=Ah)
- BYTE low_track; // First track number
- BYTE hi_track; // Last track number
- DWORD start; // Redbook binary address of the lead out
- // track
- } DiskInfo_Rec;
-
- /* *** (I) TnoInfo_Rec *** */
- /* Given the track number, returns the READBOOK address for the starting
- ** point of the the track and control information
- */
- typedef struct TnoInfo_Rec {
- BYTE code; // (=Bh)
- BYTE tno; // Track request byte
- DWORD start_tno; // returned starting address (REDBOOK)
- BYTE tcntrl; // returned control byte
- } TnoInfo_Rec;
-
- /* *** (I) QchanInfo_Rec *** */
- /* Returns the current Q-channel information
- */
- typedef struct QchanInfo_Rec {
- BYTE code; // (=Ch)
- BYTE ctrl ; // Control and ADR byte
- BYTE tno; // Current track number (BCD)
- // (00==leadin,00-99 valid,AA==LeadOut)
- BYTE x; // Point (BCD) Index to TNO
- // 00==Pause encoding
- // 01-99 Subdivision numbers
- BYTE min; // (BCD) minutes running time within track
- BYTE sec; // seconds
- BYTE frame; // frame
- BYTE zero; // 00
- BYTE pmin; // (BCD) minutes running time on disc
- BYTE psec; // seconds
- BYTE pframe; // frame
- // the above running time is an entry
- // in the TOC during the LeadIn track
- // where the Point byte is the index
- } QchanInfo_Rec;
-
- /* *** (I) SubChanInfo_Rec *** */
- /* The R-W information during play can be transferred into a buffer
- ** for at least one sector. (96bytes/sector)
- */
-
- typedef struct SubChanInfo_Rec {
- BYTE code; // (=Dh)
- DWORD start_tno; // Starting Sector Address
- BYTE _far *xfer; // Transfer Address
- DWORD nsect; // Number of sectors to read
- } SubChanInfo_Rec;
-
- /* *** (I) UPCCode_Rec *** */
- /* The UPC code *if any* is returned in the seven byte upc array
- */
- typedef struct UPCCode_Rec {
- BYTE code; // (=Eh)
- BYTE ctrl_adr; // Control and ADR byte
- BYTE upc[7]; // UPC code (BCD)
- BYTE zero; // 0
- BYTE aframe; // Continuation of FRAME in mode 1
- } UPCCode_Rec;
-
- /* *** (I) AudStat_Rec *** */
- /* The Audio Status request structure. Holds information for paused
- ** status and starting/ending locations for PLAY and RESUME
- */
- typedef struct AudStat_Rec {
- BYTE code; // (=Fh)
- WORD stat_bits; // (bit 0 is PAUSED bit)
- DWORD start_tno; // Starting REDBOOK addr of last play
- // or next resume
- DWORD end_tno; // Ending location for the last play or
- // next resume
- } AudStat_Rec;
-
- /* *** Eject, CloseTray and ResetDrv only require single byte *** */
-
- typedef struct LockDoor_Rec {
- BYTE code; // (=1h)
- BYTE fcn; // (fcn = 0, unlocks; fcn = 1, locks))
- } LockDoor_Rec;